﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MPSE.Portal2;

public partial class MasterPage_Site : System.Web.UI.MasterPage
{
    #region Page_Load
    protected void Page_Load(object sender, EventArgs e)
    {
        //desabilita o voltar depois que realizar o logoff
        //Response.Cache.SetCacheability(HttpCacheability.NoCache);

        if (!Page.IsPostBack)
        {
            MontarMenu();
            //if (Session["usuario"] != null)
            //{
            //    //usuário logado
            //    UsuarioAplicacao usuario = (UsuarioAplicacao)Session["usuario"];
            //    UsuarioLabel.Text = usuario.Nome;
            //}
        }
    }
    #endregion

    #region MontarMenu
    /// <summary>
    /// Montar Menu de acordo com o tipo de usuário
    /// </summary>
    private void MontarMenu()
    {
        SiteMapDataSource PadraoSiteMapDataSource = new SiteMapDataSource();
        PadraoSiteMapDataSource.ShowStartingNode = false;
        PadraoSiteMapDataSource.SiteMapProvider = "Menu";
        PadraoMenu.DataSource = PadraoSiteMapDataSource;
        PadraoMenu.DataBind();
    }
    #endregion
}
